<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "api" middleware group. Make something great!
|
*/

Route::get('/strategy/get_desc', [\App\Http\Controllers\StrategyController::class, 'getStrategyDesc']);
Route::post('/admin/login', [\App\Http\Controllers\AdminController::class, 'login']);
// 定时任务
// 定时任务-最高价
Route::get('/schedule/update_hightest_and_lowest_price', [\App\Http\Controllers\ScheduleController::class, 'updateHightestAndLowestPrice']);
// 定时任务-监控止损和止盈
Route::get('/schedule/monitor', [\App\Http\Controllers\ScheduleController::class, 'monitor']);
// 监控
Route::get('/monitor/get_monitor_info', [\App\Http\Controllers\MonitorController::class, 'getMonitorInfo']);
// 管理员
Route::get('/test/test', [\App\Http\Controllers\TestController::class, 'test']);
Route::get('/test/transform', [\App\Http\Controllers\TestController::class, 'transform']);
Route::get('/kline/transform', [\App\Http\Controllers\KlineController::class, 'transform']);
// 一年一次同步即可
Route::get('/date/sync', [\App\Http\Controllers\DateController::class, 'syncHoliday']);
Route::middleware([])->group(function () {
// Route::middleware(['auth:sanctum'])->group(function () {
    // 资金
    Route::get('/money/list', [\App\Http\Controllers\MoneyLogController::class, 'list']);
    Route::get('/money/get_types', [\App\Http\Controllers\MoneyLogController::class, 'getTyps']);
    Route::get('/money/get_money_detail', [\App\Http\Controllers\MoneyLogController::class, 'getMoneyDetail']);
    Route::post('/money/save', [\App\Http\Controllers\MoneyLogController::class, 'save']);

    // 监控
    Route::post('/monitor/save', [\App\Http\Controllers\MonitorController::class, 'save']);
    //文件上传
    Route::post('/upload/pic', [\App\Http\Controllers\UploadController::class, 'uploadPic']);
    // 统计
    Route::get('/statistics/chart_statistics', [\App\Http\Controllers\StatisticsController::class, 'getChartStatistics']);
    Route::get('/statistics/get_month_rate', [\App\Http\Controllers\StatisticsController::class, 'getMonthRate']);
    Route::get('/statistics/get_money_rate_percent', [\App\Http\Controllers\StatisticsController::class, 'getMoneyRatePercent']);
    Route::get('/statistics/top_statistics', [\App\Http\Controllers\StatisticsController::class, 'getTopStatistics']);
    // 股票操作记录
    Route::get('/operate/list', [\App\Http\Controllers\OperateController::class, 'list']);
    Route::post('/operate/save', [\App\Http\Controllers\OperateController::class, 'save']);
    Route::post('/operate/finish', [\App\Http\Controllers\OperateController::class, 'finish']);
    Route::post('/operate/set_archive', [\App\Http\Controllers\OperateController::class, 'setArchive']);
    Route::get('/operate/get_operate_info', [\App\Http\Controllers\OperateController::class, 'getOperateInfo']);
    Route::get('/operate/get_operate_kline', [\App\Http\Controllers\OperateController::class, 'getOperateKline']);
    // 笔记
    Route::get('/note/detail/{id}', [\App\Http\Controllers\NoteController::class, 'detail']);
    Route::post('/note/save', [\App\Http\Controllers\NoteController::class, 'save']);
    // 风险自测
    Route::get('/risk/check_list', [\App\Http\Controllers\RiskController::class, 'checkList']);
    Route::get('/risk/list', [\App\Http\Controllers\RiskController::class, 'list']);
    Route::post('/risk/save', [\App\Http\Controllers\RiskController::class, 'save']);
    Route::post('/risk/delete', [\App\Http\Controllers\RiskController::class, 'delete']);
    Route::get('/risk/option_list', [\App\Http\Controllers\RiskController::class, 'optionList']);
    Route::get('/risk/risk_detail', [\App\Http\Controllers\RiskController::class, 'riskDetail']);
    Route::post('/risk/save_risk_check', [\App\Http\Controllers\RiskController::class, 'saveRiskCheck']);
    Route::post('/risk/save_risk', [\App\Http\Controllers\RiskController::class, 'saveRisk']);
    Route::get('/risk/risk_check_detail', [\App\Http\Controllers\RiskController::class, 'riskCheckDetail']);
    // 交易
    Route::get('/deal/list', [\App\Http\Controllers\DealController::class, 'list']);
    Route::post('/deal/save', [\App\Http\Controllers\DealController::class, 'save']);
    Route::get('/deal/check_price_change', [\App\Http\Controllers\DealController::class, 'scheckPriceChangeave']);
    Route::get('/deal/get_deal_info', [\App\Http\Controllers\DealController::class, 'getDealInfo']);
    // 配置
    Route::get('/config/get_market_index_options', [\App\Http\Controllers\ConfigController::class, 'getMarketIndexOptions']);
    Route::get('/config/info', [\App\Http\Controllers\ConfigController::class, 'info']);
    Route::post('/config/save', [\App\Http\Controllers\ConfigController::class, 'save']);
    // 获取策略描述，如：http://stock.vsonter.com/api/strategy/get_desc?id=4
    Route::get('/strategy/get_options', [\App\Http\Controllers\StrategyController::class, 'getStrategyOptions']);
    Route::get('/strategy/get_strategy_text', [\App\Http\Controllers\StrategyController::class, 'getStrategyText']);
    Route::get('/strategy/list', [\App\Http\Controllers\StrategyController::class, 'list']);
    Route::post('/strategy/save', [\App\Http\Controllers\StrategyController::class, 'save']);
    Route::get('/strategy/get_strategy_info', [\App\Http\Controllers\StrategyController::class, 'getSttategyInfo']);
    Route::get('/strategy/update_earning_rate', [\App\Http\Controllers\StrategyController::class, 'updateEarningRate']);
    // 关注
    Route::get('/follow/list', [\App\Http\Controllers\FollowController::class, 'list']);
    Route::post('/follow/save', [\App\Http\Controllers\FollowController::class, 'save']);
    Route::get('/follow/get_stock_info', [\App\Http\Controllers\FollowController::class, 'getStockInfo']);
    Route::get('/follow/get_follow_info', [\App\Http\Controllers\FollowController::class, 'getFollowInfo']);
    Route::get('/follow/update_hightest_and_lowest_price', [\App\Http\Controllers\FollowController::class, 'updateHightestAndLowestPrice']);
    // 管理员
    Route::post('/admin/save', [\App\Http\Controllers\AdminController::class, 'save']);
    Route::post('/admin/save_password', [\App\Http\Controllers\AdminController::class, 'savePassword']);
    Route::get('/admin/list', [\App\Http\Controllers\AdminController::class, 'list']);
    Route::get('/admin/info', [\App\Http\Controllers\AdminController::class, 'info']);
    Route::post('/admin/logout', [\App\Http\Controllers\AdminController::class, 'logout']);
    // 每天策略
    Route::get('/every/list', [\App\Http\Controllers\EveryController::class, 'list']);
    Route::get('/every/get_every_detail', [\App\Http\Controllers\EveryController::class, 'getEveryDetail']);
    Route::post('/every/save', [\App\Http\Controllers\EveryController::class, 'save']);
    // 板块机会
    Route::get('/category/list', [\App\Http\Controllers\CategoryController::class, 'list']);
    Route::get('/category/get_category_detail', [\App\Http\Controllers\CategoryController::class, 'getCategoryDetail']);
    Route::get('/category/get_category_parents', [\App\Http\Controllers\CategoryController::class, 'getParentCategory']);
    Route::post('/category/save', [\App\Http\Controllers\CategoryController::class, 'save']);
    // 我的检讨
    Route::get('/review/list', [\App\Http\Controllers\ReviewController::class, 'list']);
    Route::get('/review/get_review_detail', [\App\Http\Controllers\ReviewController::class, 'getReviewDetail']);
    Route::post('/review/save', [\App\Http\Controllers\ReviewController::class, 'save']);
    //myTest
    Route::get('/mytest/test', [\App\Http\Controllers\MyTestController::class, 'test']);
});